home *** CD-ROM | disk | FTP | other *** search
/ Visual FX for Image FX / VisualFX for Image FX 3.adf / Files / SetUp / 03 / 14.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1997-08-25  |  7.0 KB  |  308 lines

  1. /*
  2.                                  Visual FX
  3.                                     For
  4.                                  Image FX
  5.                                SetUp Script
  6.                            Written By J.L. White
  7.  
  8.                          (C)1997 Merlin's Software
  9.  
  10. */
  11.  
  12. parse arg Num Frames
  13. options results
  14. address "IMAGEFX.1"
  15. ReDraw On
  16.  
  17.     RequestResponse "Do You Need Instructions?"
  18.     if rc = 0 then do
  19.         call Docs()
  20.         end    
  21.  
  22. if exists("libs:flyer.library") then do
  23.     if (POS('PROJECT_REXX_PORT',SHOW('Ports')) =0) then do
  24.         RequestNotify 'Flyer Must Be Running First!'
  25.         exit
  26.         end
  27.     call OpenFlyStuff()
  28.  
  29.  
  30.     Gadget.1 = 'D/110/22/120/ImageA Type/4/FLYER CLIP/FLYER STILL/FRAME/SEQUENCE'
  31.     ComplexRequest  '"Visual FX  SetUp Options"' 1 Gadget 250 60
  32.     if rc ~= 0 then do
  33.         call CloseStuff()
  34.         exit 0
  35.         end
  36.     else do
  37.         IAType = RESULT.1
  38.            end
  39.  
  40.     call GetA()
  41. end
  42. else do
  43.     Gadget.1 = 'D/110/22/120/ImageA Type/2/FRAME/SEQUENCE'
  44.     ComplexRequest  '"Visual FX  SetUp Options"' 1 Gadget 250 60
  45.     if rc ~= 0 then do
  46.         call CloseStuff()
  47.         exit 0
  48.         end
  49.     else do
  50.         IAType = RESULT.1+2
  51.            end
  52.  
  53.     call GetA()
  54. end
  55.  
  56. if FlyOn = 1 then
  57.     call CloseStuff()
  58.  
  59.  
  60.     Gadget.1 = ' Select Direction! '
  61.     Gadget.2 = ' Horizontal '
  62.     Gadget.3 = ' Vertical '
  63.     ListRequest 3 Gadget
  64.     DirectionType = "Horiz"
  65.     if result = 2 then DirectionType = "Horiz"
  66.     if result = 3 then DirectionType = "Vert"
  67.  
  68.     Gadget.1 = ' Select Speed Of Effect! '
  69.     Gadget.2 = ' Slow '
  70.     Gadget.3 = ' Medium '
  71.     Gadget.4 = ' Fast '
  72.     ListRequest 4 Gadget
  73.     SANum = 16
  74.     SBNum = 24
  75.     if result = 2 then do
  76.         SANum = 31
  77.         SBNum = 12
  78.         end
  79.     if result = 3 then do
  80.         SANum = 16
  81.         SBNum = 24
  82.         end
  83.     if result = 4 then do
  84.         SANum = 11
  85.         SBNum = 36
  86.         end
  87.  
  88.     RequestSlider '"Enter Total Amount Of Distortion!"' 1 255 120
  89.     TAmount = Result
  90.  
  91.     RequestSlider '"Enter Total Amount Of Waves!"' 1 100 5
  92.     Waves = Result
  93.  
  94.     CropAnswer = "None"
  95.     RequestResponse "Does Image Need To Be Cropped?"
  96.     if rc = 0 then do
  97.         call LoadA()
  98.         call CropPic()
  99.         end    
  100.  
  101. call open TempFile,"VFXIFX:TempDrawer/"strip(Num),W
  102. call writeln TempFile,PicAName
  103. call writeln TempFile,Start
  104. call writeln TempFile,End
  105. call writeln TempFile,IAType
  106. call writeln TempFile,DirectionType
  107. call writeln TempFile,Waves
  108. call writeln TempFile,TAmount
  109. call writeln TempFile,SANum
  110. call writeln TempFile,SBNum
  111. call writeln TempFile,CropAnswer
  112. call close TempFile
  113. exit
  114.  
  115.  
  116.  
  117. CropPic:
  118.     Learn "RAM:VFX" NoHeader Quiet Force
  119.     Crop
  120.     Learn Stop Quiet Force
  121.  
  122.     call open TempFile,"RAM:VFX.ifx",R
  123.     do until eof(TempFile)
  124.         line = readln(TempFile)
  125.         parse var line StartLine" "RestOfLine
  126.         if StartLine = "Crop" then CropAnswer = line
  127.         end
  128.     call close TempFile
  129.     address command "Delete >NIL: Ram:VFX.ifx"
  130.  
  131. return
  132.  
  133. GetFile:
  134.     parse Arg Title, Path
  135.     Address FLY_1 SetString Path
  136.     Address FLY_1 GetFileNameNT Title
  137. return result
  138.  
  139. GetFileName: procedure  
  140.    ARG CompleteName
  141.    c = lastpos("/",CompleteName)
  142.    if c = 0 then c = lastpos(":",CompleteName)
  143.    return substr(CompleteName, c + 1)
  144.  
  145.  
  146. GetA:
  147.  if IAType = 0 then do
  148.     call Switcher(TOSW)
  149.     PicAName = GetFile("Select Flyer Clip For ImageA!  ",DriveName)
  150.     Name = GetFileName(PicAName)
  151.     if Name = "" then do
  152.         Address FLY_1 OK_TEXT " OK "
  153.         Title = "You Must Enter A Valid Clip Name To Use!"
  154.         Address FLY_1 FYINT Title
  155.         Address FLY_1 Quit
  156.         call Switcher(TOWB)
  157.         exit
  158.         end
  159.     Address FLY_1 SetFileName PicAName
  160.     Address FLY_1 GetClipLength PicAName
  161.     End = result
  162.     Start = 0
  163.     Address FLY_1 Program "5"
  164.     Address FLY_1 StartNum Start
  165.     Address FLY_1 EndNum End
  166.     Address FLY_1 CurrentNum "0"
  167.     Address FLY_1 GetTimeNT "Select A Range Of Frames To Process!"
  168.     Start = word(result,1)*2
  169.     End = word(result,2)*2
  170.     Start  = Start + 1
  171.     End = End +2
  172.     call addlib('PROJECT_REXX_PORT' , 0)
  173.     call addlib(TOASTERLIB,0)
  174.     call Switcher(TOWB)
  175.     address command "C:Wait 1"
  176.     ScreenToFront
  177.     end
  178.    if IAType = 1 then do
  179.     RequestFile '"Select Flyer Still For ImageA!"' DriveName ' '
  180.     PicAName = result
  181.     Name = GetFileName(PicAName)
  182.     if Name = "" then do
  183.         Title = "You Must Enter A Valid Name To Use!"
  184.         RequestNotify Title
  185.         if FlyOn = 1 then Address FLY_1 Quit
  186.         exit
  187.         end
  188.     RequestNumber '"Enter Number Of Frames To Process!"' Frames
  189.     End = result
  190.     Start = 1
  191.     end
  192.    if IAType = 2 then do
  193.     RequestFile '"Select FileName For ImageA!"' 'SYS:' ' '
  194.     PicAName = result
  195.     Name = GetFileName(PicAName)
  196.     if Name = "" then do
  197.         Title = "You Must Enter A Valid Name To Use!"
  198.         RequestNotify Title
  199.         if FlyOn = 1 then Address FLY_1 Quit
  200.         exit
  201.         end
  202.     RequestNumber '"Enter Number Of Frames To Process!"' Frames
  203.     End = result
  204.     Start = 1
  205.     end
  206.    if IAType = 3 then do
  207.     RequestFile '"Select BaseName For ImageA! "' 'SYS:' ' '
  208.     PicAName = result
  209.     Name = GetFileName(PicAName)
  210.     if Name = "" then do
  211.         Title = "You Must Enter A Valid Name To Use!"
  212.         RequestNotify Title
  213.         if FlyOn = 1 then Address FLY_1 Quit
  214.         exit
  215.         end
  216.     RequestNumber '"Enter Number Of Frames To Process!"' Frames
  217.     End = result
  218.     Start = 1
  219.     end
  220. return
  221.  
  222. CloseStuff:
  223.     Address FLY_1 Quit
  224.     call remlib('ToasterARexx.port')
  225.     call remlib('PROJECT_REXX_PORT')
  226. return
  227.  
  228.  
  229. OpenFlyStuff:
  230.     FlyOn = 1
  231.     address command "run VFXIFX:FLY" 
  232.     do while (POS('FLY_1',SHOW('Ports')) = 0)
  233.         address command "wait 1"
  234.         end
  235.     TOASTERLIB="ToasterARexx.port"
  236.     call remlib('ToasterARexx.port')
  237.     call remlib('PROJECT_REXX_PORT')
  238.     call addlib('PROJECT_REXX_PORT' , 0)
  239.     call addlib(TOASTERLIB,0)
  240.     DriveName = FindDrive()
  241. return
  242.  
  243.  
  244. FindDrive:
  245.     address command "C:Info >RAM:DriveList"
  246.     call open TempFile,"RAM:DriveList",R
  247.     do until eof(TempFile)
  248.         line = readln(TempFile)
  249.         parse var line Drive" "Rest
  250.         if Drive = "FA0:" then 
  251.             FlyVolume = word(Rest,7)":"
  252.     end
  253.     call close TempFile
  254.     address command "Delete >NIL: RAM:DriveList"
  255. return FlyVolume
  256.  
  257.  
  258.  
  259. LoadA:
  260.     if IAType = 0 then do
  261.         LoadBuffer PicAName Force Start
  262.         end
  263.     if IAType = 1 then do
  264.         LoadBuffer PicAName Force 1
  265.         end
  266.     if IAType = 2 then do
  267.         LoadBuffer PicAName Force
  268.         end
  269.     if IAType = 3 then do
  270.         LoadBuffer PicAName""right(Start,3,'0') Force
  271.         end
  272. return
  273.  
  274.  
  275.  
  276. Docs:
  277.  
  278.     text1 = '"This effect takes an image and uses the Dream Hook to"'
  279.     text2 = '"wiggle and shake the screen like that seen on TV in the"'
  280.     text3 = '"Dream sequence effect. It eases in & out of the effect"'
  281.     text4 = '"slowly then builds to a user defined Total Amount. You"'
  282.     text5 = '"also have option to select speed and number of waves."'
  283.     text6 = '" "'
  284.  
  285.     text7 = '"The Crop Image option is there for Flyer Users. It may"'
  286.     text8 = '"have garbage on the edges that is not seen because of"'
  287.     text9 = '"overscan, but when the image edges are wrapped around,"'
  288.     text10 = '"you can see them. This allows you to crop the image"'
  289.     text11 = '"first, then scale it back to the correct size."'
  290.  
  291.     Gadget.1  = 'TEXT LE=10 TE=4 LB='text1' '
  292.     Gadget.2  = 'TEXT LE=10 TE=14 LB='text2' '
  293.     Gadget.3  = 'TEXT LE=10 TE=24 LB='text3' '
  294.     Gadget.4  = 'TEXT LE=10 TE=34 LB='text4' '
  295.     Gadget.5  = 'TEXT LE=10 TE=44 LB='text5' '
  296.     Gadget.6  = 'TEXT LE=10 TE=54 LB='text6' '
  297.     Gadget.7  = 'TEXT LE=10 TE=64 LB='text7' '
  298.     Gadget.8  = 'TEXT LE=10 TE=74 LB='text8' '
  299.     Gadget.9  = 'TEXT LE=10 TE=84 LB='text9' '
  300.     Gadget.10  = 'TEXT LE=10 TE=94 LB='text10' '
  301.     Gadget.11  = 'TEXT LE=10 TE=104 LB='text11' '
  302.     Gadget.12 = 'END'
  303.     NewComplexRequest  '"Instructions For Effect #14"' Gadget 420 116
  304.  
  305. return
  306.  
  307.  
  308.